# a = input("请输入一个整数：")
# if a == "1":
#     print("hello")
#     print("world")

# 基础练习
"""
a = int(input("请输入一个整数："))
if a % 2 == 0:
    print("偶数")
else:
    print("奇数")
"""
"""
year = int(input("请输入一个年份："))
if (year % 100 != 0 and year % 4 == 0) or (year % 400 == 0):
    print("闰年")
else:
    print("平年")
"""
'''
a = int(input("请输入一个整数："))
if a != 1:
    pass
else:
    print("hello")
'''
"""
# 1! + 2! + 3! + ... + n!
n = int(input("请输入一个整数："))
num = 1
sum = 0
while num <= n:
    factorResult = 1
    i = 1
    while i <= num:
        factorResult *= i
        i += 1
    sum += factorResult
    num += 1
print(sum)
"""
"""
sum = 0
for i in range(1, 101):
    sum += i
print(sum)
"""
"""
def calcSum(beg, end):
    sum = 0
    for i in range(beg, end + 1):
        sum += i
    return sum
sum = calcSum(1, 100)
print(sum)

def getPoint():
    x = 10
    y = 20
    return x, y
x, y = getPoint()
print(x, y)

def factor(n):
    if n == 1:
        return 1
    return n * factor(n - 1)

result = factor(5)
print(result)
"""

# 列表
# 列表中可以存储任意类型的数据
"""
alist = []
alist = list()
print(type(alist))
alist = [1, 2, 3, 4, 5]
print(alist[0])
print(alist[1:3])
print(alist[::2])
print(alist[-1])
print(len(alist))
blist = [7, 8, 9]
alist.extend(blist)
print(alist)
"""
# 元组，列表一旦创建，就不能修改
"""
atuple = ()
atuple = tuple()
print(type(atuple))
"""
# 字典
"""
a = {}
b = dict()
print(type(a))
print(type(b))

student = {
    'id': 1001,
    'name': '张三',
    'age': 18
}
print(student)
student['score'] = 90
print(student)

for key in student:
    print(key, student[key])

print(student.keys())
print(student.values())
print(student.items())
"""

f = open('D://TEST/1.txt', 'r', encoding='utf-8')
result = f.readlines()
print( result)
f.close()

with open('D://TEST/1.txt', 'r', encoding='utf-8') as f:
    result = f.readlines()
    print(result)
